import { createApp } from 'vue'
// import { createPinia } from 'pinia'
import { Button } from 'vant'
import pinia from './stores/index'
import App from './App.vue'
import router from './router'
// import { Form, Field, CellGroup } from 'vant'
import 'amfe-flexible'
// 瀑布流插件
import { VueMasonryPlugin } from 'vue-masonry'
// 全局组件
import SearchBar from '@/components/SearchBar/index.vue'
import SearchIcon from '@/components/SearchIcon/index.vue'
import TabBar from '@/components/TabBar/index.vue'
// 全局css样式
import '@/assets/css/index.css'
// 引入Vant中无法自动引入的组件的样式 Toast，Dialog，Notify 和 ImagePreview 这四个Vant组件在使用时需要手动引入 例如：import { showToast } from 'vant';
import 'vant/es/toast/style'
import 'vant/es/dialog/style'
import 'vant/es/notify/style'
import 'vant/es/image-preview/style'
// 懒加载组件
import { Lazyload } from 'vant'
// 全局前置守卫
import './permission'

const app = createApp(App)

app.use(VueMasonryPlugin)

// app.use(createPinia())
app.use(pinia)
app.use(router)
app.use(Button)
app.use(Lazyload)

// 注册全局组件
app.component(SearchBar.name, SearchBar)
app.component(SearchIcon.name, SearchIcon)
app.component(TabBar.name, TabBar)

app.mount('#app')
// app.use(Form)
// app.use(Field)
// app.use(CellGroup)
